﻿<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php 
include_once '../../conn/mysql.php';
$user=$_POST["user"];
$pwd=md5($_POST["pwd"]);
$res=sql("s","admin","*","where user='".$user."' and pwd='".$pwd."'");
$info=firstrow($res);
if(isset($info["pwd"])){

if($info["pwd"]==$pwd){
	session_start();
	$_SESSION["admin"]=$user;
	echo "<script>window.location.href='../index.php';</script>";
}else{
	echo "<script>alert('用户名或密码错误');window.location.href='index.html';</script>";
}
}else{
	echo "<script>alert('用户名或密码错误');window.location.href='index.html';</script>";
}
?>